<template>
  <div class="img">
    <el-upload
      class="avatar-uploader"
      action="https://jsonplaceholder.typicode.com/posts/"
    >
      <img v-if="imageUrl" :src="imageUrl" class="avatar" />
      <i v-else class="el-icon-circle-close avatar-uploader-icon">上传图片</i>
    </el-upload>
  </div>
</template>

<script>
export default {};
</script>

<style>
.avatar-uploader .el-upload {
  display: flex;
  align-items: center;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  margin-left: 10px;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  position: relative;
  font-size: 14px;
  color: #8c939d;
  width: 88px;
  height: 58px;
  line-height: 58px;
  text-align: center;
}
.avatar {
  width: 88px;
  height: 58px;
  display: block;
}
.el-icon-circle-close:before{
  position: absolute;
  top: -26px;
  right: -7px;
  font-size: 28px;
  background-color: white;
  height: 38px;
}
</style>